<?php
/*
Template Name: 本会简介
 */
get_header();
?>
<!-- 列表模块 -->
<div class="main-container">
    <div class="wrap">
        <p class="page-title">本会简介</p>
        <div class="clearfix">
            <div class="about-container">
                <h2><?php the_title(); ?></h2>
                <div class="about-content">
                    <?php
                        while(have_posts()) {
                            the_post();
                            the_content();
                        }
                    ?>
                </div>
            </div>
            <div class="about-sidebar">
                <ul>
                    <?php
                     $sideNav = array(
                         'index'=> '简介',
                         'organization'=> '组织机构',
                         'department'=> '部门',
                         'association'=> '章程',
                         'system'=> '制度'
                     );
                     foreach( $sideNav as $key => $nav) {
                    ?>
                        <li><a  href="/about/<?php echo $key;?>" title=""><?php echo $nav;?></a></li>
                    <?php
                     }
                    ?>
                </ul>
            </div>
        </div>
    </div>
</div>
    
    <?php
    get_footer();
?>
<script>
    (function() {
        var
        fileName=location.pathname.split('/').pop(),
        $nav=$('.about-sidebar'),
        $navLi=$nav.find('li'),
        $navLiA=$navLi.find('a');
        for(var i=0,len=$navLi.length; i<len; i++){
            if($navLiA.eq(i).attr('href').split('/')[2]==fileName){
                $navLi.eq(i).addClass('on');
            }
        }

    })();
</script>

</body>
</html>